package cn.distribution.messagesManager.service;

import cn.distribution.messagesManager.entity.dao.MessagesManagerDAO;
import cn.distribution.messagesManager.entity.vo.MessagesManagerVO;
import cn.distribution.messagesManager.mapper.MessagesManagerMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zhengminjie
 */
@Service
public class MessagesManagerService extends ServiceImpl<MessagesManagerMapper, MessagesManagerDAO> {

    @Resource
    private MessagesManagerMapper messagesManagerMapper;

    /**
     * 通过消息类型和状态统计个数
     */
    public Long getCount(Long messageType, String userName){
        return messagesManagerMapper.getCount(messageType,userName);
    }

    /**
     * 通过消息类型和用户名 查找第一条消息内容
     */
    public MessagesManagerDAO getContent(Long messageType, String userName){
        return this.messagesManagerMapper.getContent(messageType, userName);
    }
}
